package com.company.jvm;

import java.util.HashSet;

//-Xms1m -Xmx8m -XX:+HeapDumpOnOutOfMemoryError
public class Demo01 {
    byte[] array = new byte[1024 * 1024]; //1m

    public static void main(String[] args) {
        String str = "840770968@qq.com,1479465042@qq.com,511252991@qq.com,313853262@qq.com,fjort@126.com,1620153236@qq.com,jelly187@163.com,986005580@qq.com,20144960@qq.com,1350360878@qq.com,838090335@qq.com,212175236@qq.com,ljbcom3@163.com,107233900@qq.com,2592729912@qq.com,1809131522@qq.com,773184719@qq.com,491135897@qq. com,214659817@qq.com,zx0922@gmail.com,13998610888@139.com,jialin5417@gmail.com";
        String[] split = str.split(",");
        HashSet<String> objects = new HashSet<>();
        for (String s : split) {
            objects.add(s);
        }
        System.out.println(objects.size());
        System.out.println(objects.size() == split.length);

//        ArrayList<Demo01> list = new ArrayList<>();
//        int count = 0;
//
//        try {
//            while (true) {
//                list.add(new Demo01());
//                count++;
//            }
//        } catch (Exception e) {
//            System.out.println("count = " + count);
//            e.printStackTrace();
//        }
    }
}
